package artid.com.arttogoa.adapter;

import java.util.List;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.view.ViewGroup;

/**
 * ClassName:MatchFragmentAdapter <br/>
 * Function: 项目页适配器<br/>
 * Reason: 解决项目页标签可以左右滑动的功能 <br/>
 * Date: 2014-2-25 下午4:00:34 <br/>
 * 
 * @author ybq
 * @version
 * @since JDK 1.6
 * @see
 */
public class AuctionFragmentAdapter extends FragmentStatePagerAdapter {

	private List<Fragment> mList;

	public AuctionFragmentAdapter(FragmentManager fm) {
		super(fm);
	}

	public void setData(List<Fragment> list) {
		mList = list;
		notifyDataSetChanged();
	}

	@Override
	public Fragment getItem(int position) {
		return getFragments(position);
	}

	@Override
	public Object instantiateItem(ViewGroup group, int position) {
		return super.instantiateItem(group, position);
	}

	private Fragment getFragments(int position) {
		return mList.get(position);
	}

	@Override
	public int getCount() {
		return null == mList ? 0 : mList.size();
	}

	@Override
	public int getItemPosition(Object object) {
		return POSITION_NONE;
	}
}
